<%--
  Created by IntelliJ IDEA.
  User: LENOVO
  Date: 2020/8/22
  Time: 20:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset=" utf-8">
    <title>弹窗</title>
    <style type="text/css">
        #fade {    /*遮罩层*/
            display:none;  /* 元素不可见*/
            position:absolute;  /*绝对定位*/
            top:0%;
            left:0%;
            width:100%;
            height:100%;
            background-color:black;
            z-index:1;  /*元素的堆叠顺序*/
            -moz-opacity:0.3;
            opacity:.3;   /*透明度*/
            filter:alpha(opacity=3);
        }
        #light{
            display:none;
            position:absolute;
            width:400px;
            height:440px;
            top:50%;
            left:50%;
            margin:-220px 0 0 -200px;
            padding:0px;
            background-color:white;
            z-index:2;
            overflow:auto;
            border-radius: 5px;
        }
        #dv1{
            background-color: #3a3a3a;
            height: 60px;
            color: white;
            font-size: 150%;
            line-height: 60px;
        }
        #dv2{
            border-bottom: 1px solid gainsboro;
        }
        #dv3{
            text-align: center;
            padding-top: 7px;
        }
        form{
            padding-top: 30px;
            text-align: center;
            font-size: 100%;
        }
        input,select{height: 40px; width: 270px;font-size: 90%}
        label{display: block;padding: 10px }
        .btn{ height: 35px; width: 70px;border: 0px; font-size: 100%;}
        #OKbt{background-color: #64b8f9; color: white}
    </style>

</head>
<body>
<button id="openbt"> 点击这里打开窗口</button>


<div id="light">
    <div id="dv1" name="head"><span style="margin-left: 30px">标题</span></div>

    <div id="dv2" name="body" style="height: 330px">
        <form>

            <label>
            名&nbsp;&nbsp;&nbsp;字:&nbsp;<input type="text" id="name" placeholder="请输入">
            </label>
            <label>
            手机号:&nbsp;<input type="text" id="phone" placeholder="请输入">
            </label>
            <label>
                角&nbsp;&nbsp;&nbsp;色:&nbsp;
                <select id="people" >
                <option value="1">管理员</option>
                <option value="2">经理</option>
                <option value="3">员工</option>

            </label>
        </form>

    </div>

    <div id="dv3" name="foot" >
        <button id="OKbt" class="btn" >确&nbsp;&nbsp;认</button>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button id="closebt" class="btn" >取&nbsp;&nbsp;消</button>
    </div>
</div>

<div id="fade"></div>

</body>
</html>


<script type="text/javascript">
    window.onload=function(){
        var linkbt=document.getElementById("openbt");
        var light=document.getElementById('light');
        var fade=document.getElementById('fade');
        var dv1=document.getElementById('dv1');
        var closebt=document.getElementById("closebt");
        var OKbt=document.getElementById('OKbt');
        linkbt.onclick=function(){
            light.style.display='block';
            fade.style.display='block';
        }
        closebt.onclick=function(){
            light.style.display='none';
            fade.style.display='none';
        }
        OKbt.onclick=function () {
            light.style.display='none';
            fade.style.display='none';
        }
    }
</script>